<?php

class GoodsModel extends CommonModel {

    /*
     * 检查货号是否存在
     */
    public function goods_sn_exists($sn, $goods_id) {
        $map = array(
            'goods_sn' => $sn,
            'is_delete' => 0,
            'goods_id' => array('NEQ', $goods_id),
        );
        $count = $this->where($map)->count();
        return $count;
    }

}

?>
